package com.shizhan.control;

import com.shizhan.entity.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class Search {

    private static Map<String, Data> map = new HashMap<>();
    @RequestMapping(path = "/search")
    public String getPort(@RequestParam("phone") String phone){
        map = Read.readData();
        return "port:"+map.get(phone).getPort()+"password:"+map.get(phone).getPassword();
    }
}
